# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Leon Marz <main@lmarz.org>
pkgname=alembic
pkgver=1.8.6
pkgrel=0
pkgdesc="Open framework for storing and sharing scene data"
url="https://www.alembic.io/"
arch="all !s390x" # alembic does not support big-endian, which s390x uses
license="BSD-3-Clause"
makedepends="openexr-dev hdf5-dev zlib-dev cmake boost-dev samurai"
subpackages="$pkgname-dev $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/alembic/alembic/archive/$pkgver.tar.gz"

build() {
	CXXFLAGS="$CXXFLAGS -flto=auto -fno-ipa-cp"
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_SKIP_INSTALL_RPATH=ON \
		-DUSE_HDF5=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -j1
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
6371b830242be90d4ea833248df5fd42d9e713e305d15eb1383d04410319acdae5743d48d65e8f75f1cedce777d2af7d969cde095f678b17322c19f1c69f477b  alembic-1.8.6.tar.gz
"
